<!--
 * @Author: your name
 * @Date: 2021-05-25 18:30:59
 * @LastEditTime: 2021-05-26 17:51:54
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \遵义\zunyi\src\components\table.vue
-->
<template>
    <div class="contanner">
      <template>
        <el-table :data="tableData" style="width: 100%">
          <el-table-column
            v-for="(item, idx) of propArray"
            :key="idx"
            :prop="item.prop"
            :label="item.lable"
          >
          </el-table-column>
          <!-- 操作 -->
          <el-table-column fixed="right" label="操作">
            <template slot-scope="scope">
              <slot :data="scope.row" :idx="scope.$index"></slot>
            </template>
          </el-table-column>
        </el-table>
      </template>
    </div>
</template>

<script>
export default {
  props: {
    tableData: {
      type: Array,
      required: true,
    },
    propArray: {
      type: Array,
      required: true,
    },
  },
  methods: {
    handleClick(row) {
      console.log(row);
    },
  },
};
</script>

<style>
html,body{
  display: flex;
  justify-content: center;
}
.contanner {
  width: 1200px;
  margin: 0 auto;
  flex: 1;
}
</style>